#!/usr/bin/env python

from tools import config

alert=False
max = config.getAlertMax ("loadavg")
min = config.getAlertMin ("loadavg")

def get() :
	""" """
	global alert
	global max
	global min
	try:
		f=open("/proc/loadavg")
		cont=f.read().split()
		f.close()
	except:
		return 0
	if float(cont[0]) > max or float(cont[0]) < min :
		alert = True
	else :
		alert = False
	return str (cont[0]) + " " + str (cont[1]) + " " + str (cont[2])

def getAlert() :
	global alert
	return alert
